{include file="public:header" /}
<style>
    .table_form td span{color:#fff;}
</style>
<!--网站设置-->
<div class="pad_lr_10">
    <div class="col_tab">
    <ul class="J_tabs tab_but cu_li">
        <li class="current">基本设置</li>
        <li>高级设置</li>
    </ul>

    <form id="info_form" action="{:url('Setting/addDo')}" method="post">
    <div class="J_panes">
        <div class="content_list pad_10">
	<table width="100%" class="table_form">
        <tr>
            <th>网站状态 :</th>
            <td>
                <label><input type="radio" value="1" name="data[status]" checked>开启</label>
                <label><input type="radio" value="0" name="data[status]">关闭</label>
            </td>
        </tr>
        <tr id="tr-reson" style="display:none;">
            <th>关闭原因 :</th>
            <td>
                <textarea name="data[reson]" id="reson" style="width:500px;height:50px;"></textarea>
            </td>
        </tr>
        <tr>
            <th width="150">站点名称 :</th>
            <td><input type="text" name="data[title]" class="input-text" size="50" value=""></td>
        </tr>
        <tr>
            <th>电脑版logo :</th>
            <td>
                <div>
                    <img src="" alt="" id="J_pc_img_src" height="80">
                </div>
                <input type="hidden" name="data[pcLogo]" id="J_pc_img" class="input-text fl mr10" value="" size="50">
                <div id="J_pc_upload_img" class="btn btn_submit" onclick="ajaxUpload('J_pc_upload_img','J_pc_img');"><span>上传</span></div>
                图片尺寸：80*64
            </td>
        </tr>
        <tr>
            <th>手机版logo :</th>
            <td>
                <div>
                    <img src="" alt="" id="J_mobile_img_src" height="80">
                </div>
                <input type="hidden" name="data[mobileLogo]" id="J_mobile_img" class="input-text fl mr10" value="" size="50">
                <div id="J_mobile_upload_img" class="btn btn_submit" onclick="ajaxUpload('J_mobile_upload_img','J_mobile_img');"><span>上传</span></div>
                图片尺寸：160*43
            </td>
        </tr>
        <tr>
            <th>微信公众号二维码 :</th>
            <td>
                <div>
                    <img src="" alt="" id="J_weixin_img_src" height="80">
                </div>
                <input type="hidden" name="data[weixin_pic]" id="J_weixin_img" class="input-text fl mr10" value="" size="50">
                <div id="J_weixin_upload_img" class="btn btn_submit" onclick="ajaxUpload('J_weixin_upload_img','J_weixin_img');"><span>上传</span></div>
                图片尺寸：250*250
            </td>
        </tr>
        <tr>
            <th>备案号 :</th>
            <td><input type="text" name="data[icp]" class="input-text" size="50" value=""></td>
        </tr>
        <tr>
            <th>客服电话 :</th>
            <td><input type="text" name="data[telphone]" class="input-text" size="50" value=""></td>
        </tr>
        <tr>
            <th>客服QQ :</th>
            <td><input type="text" name="data[qq]" class="input-text" size="50" value=""></td>
        </tr>
        <tr>
            <th>楼盘红包 :</th>
            <td>
                <input type="radio" name="data[hongbao]" value="1">开启
                <input type="radio" name="data[hongbao]" value="0" checked>关闭
            </td>
        </tr>
        <tr>
            <th>问答审核 :</th>
            <td>
                <input type="radio" name="data[checkask]" value="1">开启
                <input type="radio" name="data[checkask]" value="0" checked>关闭
            </td>
        </tr>
        <tr>
            <th>回答审核 :</th>
            <td>
                <input type="radio" name="data[checkanswer]" value="1">开启
                <input type="radio" name="data[checkanswer]" value="0" checked>关闭
            </td>
        </tr>
	</table>

            </div>
        <div class="content_list pad_10 hidden">
            <table width="100%" class="table_form">
                <tr>
                    <th width="150">企业名称 :</th>
                    <td><input type="text" name="data[companyname]" class="input-text" value="" size="40"></td>
                </tr>
                <tr>
                    <th>SEO 标题 :</th>
                    <td><input type="text" name="data[seo_title]" class="input-text" size="50" value=""></td>
                </tr>
                <tr>
                    <th>SEO 关键词 :</th>
                    <td><input type="text" name="data[seo_keys]" class="input-text" size="50" value=""></td>
                </tr>
                <tr>
                    <th>SEO 描述 :</th>
                    <td><textarea rows="3" cols="50" name="data[seo_desc]"></textarea></td>
                </tr>
                <tr>
                    <th></th>
                    <td style="color:#ff0000;">注：{city}为变量，请不要删除或更改，在前台将自动替换为用户所选择的城市名称。</td>
                </tr>
                <tr>
                    <th>邮　　箱 :</th>
                    <td>
                        <input type="text" name="data[email]" class="input-text" value="" size="30">
                    </td>
                </tr>

                <tr>
                    <th>公司地址 :</th>
                    <td>
                        <textarea name="data[address]" id="" style="width:500px;height:100px;"></textarea>
                    </td>
                </tr>
                <tr>
                    <th>统计代码 :</th>
                    <td>
                        <textarea name="data[countcode]" id="countcode" style="width:500px;height:100px;"></textarea>统计代码、客服代码等可以放在此处
                    </td>
                </tr>
                <tr>
                    <th>手机版js代码 :</th>
                    <td>
                        <textarea name="data[mobileJs]" id="mobileJs" style="width:500px;height:100px;"></textarea>统计代码、客服代码等可以放在此处
                    </td>
                </tr>
            </table>
        </div>
        </div>
        <input type="hidden" name="name" value="{$action_name}">
        <div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>

    </form>
</div>
</div>
{include file="public:footer" /}
<script src="__PUBLIC__/js/plugins/jquery.tools.min.js"></script>
<script src="__PUBLIC__/js/plugins/fileuploader.js"></script>
<script>
$(function(){
    $('ul.J_tabs').tabs('div.J_panes > div');
    $("input[name='data[status]']").click(function(){
        var value = $(this).val();
        if(value == 1){
            $("#tr-reson").hide();
            $("#reson").val('');
        }else{
            $("#tr-reson").show();
        }
    });

});
function ajaxUpload(btn,input){
    //上传图片

    var img_uploader = new qq.FileUploaderBasic({
        allowedExtensions: ['jpg','gif','jpeg','png','swf'],
        button: document.getElementById(btn),
        multiple: false,
        action: "{:url('Setting/ajaxUploadImg')}",
        inputName: 'img',
        forceMultipart: true, //用$_FILES
        messages: {
            typeError: "{file} 文件类型不符合: {extensions}.",
            sizeError: "{file} 太大了, 最大不超过 {sizeLimit}.",
            minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
            emptyError: "{file} is empty, please select files again without it.",
            noFilesError: "No files to upload.",
            onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."
        },
        showMessage: function(message){
            layer.msg(message,{icon:2});
        },
        onSubmit: function(id, fileName){
            $('#'+btn).addClass('btn_disabled').find('span').text('上传中，请稍候...');
        },
        onComplete: function(id, fileName, result){
            $('#'+btn).removeClass('btn_disabled').find('span').text('上传');
            if(result.status == '1'){
                $('#'+input).val(result.data);
                $('#'+input+'_src').attr('src',result.data);
            } else {
                layer.msg(result.msg,{icon:2});
            }
        }
    });
}
</script>
</body>
</html>